1. Field of the Invention
The present invention relates to an apparatus, method, and computer program which adjust a distribution of brightness of a digital image.
2. Description of the Related Art
As one of methods for capturing a photograph with correct brightness, a method has previously been known which measures average luminance of a scene to be photographed to control a shutter speed, an aperture value, and the like of a camera using the measured result. Further, an exposure control method by the so-called evaluative light metering method has been known which divides a scene into predetermined regions, assigns a weight to the luminance measured for each divided region, and determines average luminance using its result, thereby obtaining correct exposure.
However, in a backlight scene, which is a scene in which the brightness of a main object to be photographed is significantly dark compared with the brightness of a background, in a captured image, the portion of the main object is darkened. In such a backlight scene, in order to capture a photograph with correct brightness, exposure of a camera needed to be set so as to be rather brightly photographed before photographing. However, an operation of such an exposure correction not only is burdensome but also requires skill to correctly perform a setting of the camera. Further, when an exposure correction has correctly been performed on the main object, the background portion may be made too bright.
Also in a scene such as the backlight scene or the like which is difficult to correctly determine the brightness of an image, it is required to obtain an image with correct brightness. In analog photography, a dodging process can be performed, thereby allowing a print with correct brightness to be obtained. The dodging process in the analog photography performs normal exposure in a section of an intermediate density, reduces the amount of exposure in a bright section in which the image has high luminance and is likely to be saturated, and increases the amount of exposure in a dark section in which the image is likely to be crushed. Also in digital image processing, it is desirable to realize such a dodging process.
As a method for realizing such the processing, there is, for example, a technique discussed in Jobson., et al., “A Multiscale Retinex for Bridging the Gap between Color Images and the Human Observation of Scenes”, IEEE TRANSACTIONS ON IMAGE PROCESSING, Vol. 6, No. 7, July 1997. This technique performs differential processing between a component obtained by logarithmically converting a digital image and a low frequency component of its logarithmically converted component, thereby performing processing to darken a bright component in a low frequency region of the digital image and brighten a dark component in the low frequency region thereof. Thus, this technique performs processing in this manner, thereby improving the image.
Further, in Reinhard, et al., “Photographic Tone Reproduction for Digital Images”, ACM Transactions on Graphics, Vol. 21, No. 3, July 2002, a method is also discussed which uses a luminance component of a digital image and a low frequency component of its digital image, thereby obtaining an effect like a dodging process in digital image processing.
Furthermore, a demand for correction of an image is not limited to a still image but is similar to that in a moving image. The moving image can be regarded as a gathering of a series of still images continued in the time axis direction. Thus, a technique concerning correction of the image as described above can easily be applied to the moving image or the like.
There are various color spaces which defines image data. The color spaces include, for example, red-green-blue (RGB), particularly, standard RGB (sRGB) described in International Electrotechnical Commission (IEC) 61966-2-1, YCbCr obtained by performing linear transformation on RGB (particularly, a color space obtained by performing RGB-YCC transformation on the above-described sRGB is referred to as sYCC), Commission International de I'Éclairage (CIE) 1931XYZ, CIE Luminescence alpha beta (L*a*b*), and the like. In a color space other than RGB among color spaces described above, a scale for representing brightness, in other words, an axis corresponding to luminance is present. Specifically, Y in YCbCr color space, Y in CIE 1931XYZ color space, and L* in CIE L*a*b* color space correspond to an axis corresponding to luminance. Further, the remaining values, in other words, Cb and Cr in YCbCr color space, X and Z in CIE 1931XYZ, and a* and b* in CIE L*a*b* color space, correspond to an axis for representing color. Alternatively, there is also a case in which a value for representing these colors is converted into a local coordinate expression and a distance from the origin is referred to as “saturation”.
In order to adjust brightness of an image, image data for correction may be transformed into these color spaces (as needed), thereby operating a value corresponding to luminance in its color space. However, in the above-described image processing method for realizing the digital dodging process, when the image is brightly corrected, the image may excessively brightly be modified on the bright side of the boundary between a bright section and a dark section in the image. When an image of a person in a backlight state is modified, the bright section occurs along the contour of the person and the occurred bright section (overcorrected section) is visible like a nimbus. Thus, this is referred to as a halo (nimbus). When such the halo occurs, in particular, since an originally bright section is further brightened by overcorrection, color saturation may also occur to lose color. Thus, there is a situation that may be recognized as a reduction in image quality.
To meet this situation, Jobson, et al., U.S. Pat. No. 6,768,514 discusses a method for switching resolution of low frequency component extraction in the vicinity of the edge of an image. However, this method needs edge component extraction processing. Thus, when realizing it by hardware, it is necessary to add a configuration for edge extraction. Further, when configuring it by software, there is an issue that makes processing heavy.